#ifndef __FRAME_CONTROL__
#define __FRAME_CONTROL__
#include "Header.h"

#define FPS_LIMIT 30


class FrameController
{
public:
	static FrameController* getInstance()
	{
		if (!m_pInstance)
			m_pInstance = new FrameController;
		return m_pInstance;
	}
	~FrameController();
	void setFPSLimit(UINT32 fps_limit);
	void startTimer();
	void endTimer();
	UINT32 getDeltaTime() { return m_iDeltaTime; }
	UINT32 getCurrentFPS() { return (m_iDeltaTime)? 1000 / m_iDeltaTime : 0; }
protected:
	FrameController();
protected:
	static FrameController* m_pInstance;
	UINT32 m_iFPSLimit;
	UINT32 m_iDeltaTimeLimit;
	UINT32 m_iDeltaTime;
	UINT64 m_iStartTime;
};

#endif